@extends('Layout/adminBase')
@section('css')
<link rel="stylesheet" type="text/css" href="{{asset('/bootstrap/css/bootstrap.min.css')}}">
<style type="text/css">
    tr{
        text-align: center;
    }
    tr th{
         text-align: center;
    }
</style>
@endsection
@section('body')
@if (session('cont'))
	<script type="text/javascript">
		alert("{{session('cont')}}");
	</script>
@endif

<div id="msg">
	@include('Common/tip')
</div>
	
	<div class='container'>
    
    <table class="table table-condensed">
        <caption>积分商品</caption>
        <thead>
            <tr>
                <th>序号</th>
                <th>商品名</th>
                <th>商品图片</th>
                <th>商品详情</th>
                <th>积分价格</th>
                <th>库存</th>
                <th>状态</th>
                <th>上架时间</th>
                <th>下架时间</th>
                <th width="20%" align="center">操作</th>
            </tr>
        </thead>
        <tbody>
        @foreach ($goods as $k => $v)
            <tr>
                <td>{{$k+1}}</td>
                <td>{{$v->ig_name}}</td>
                <td><img src="{{$v->image}}" style="width:50px; height:30px;"></td>
                <td>{{$v->detail}}</td>
                <td>{{$v->integral_price}}</td>
                <td>{{$v->stock}}</td>
                <td>{{$state[$v->status]}}</td>
                <td>{{$v->date_issued}}</td>
                <td>{{$v->date_under}}</td>
                <td>
                    <a class="btn btn-default btn-xs btnPrimary" href="{{url('admin/integral/edit')}}/{{$v->id}}">修改</a>
                   	<a class="btn btn-default btn-xs btnError" href="{{url('admin/integral/destroy')}}/{{$v->id}}">删除</a>
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
    {{ $goods->links() }}
	</div>

@endsection

@section('footer-js')
	
	<script>
	  //一次性定时器 让提示2秒后消失
	 setTimeout(function () {

	      var msg = document.getElementById('msg');

	      msg.style.display = 'none';

	    }, 2000);
	</script>

@endsection